<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<!DOCTYPE html>
<html class="no-js">
<head>
	<meta name="author" content="蓝凌科技">
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link href="/Public/Blovex4/css/amazeui.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/amaze.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/admin.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/jquery.datetimepicker.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/custom.css" rel="stylesheet">
	<link href="/Public/Common/css/amazeui.datetimepicker.css" rel="stylesheet">
	<title><?php echo C('WEB_SITE_TITLE');?></title>
	
	<script type="text/javascript">
	    var _root = '<?php echo ($_site_url); echo U(' / ');?>', _controller = '<?php echo ($_controller); ?>';
	</script>
	
	
	

	<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->


</head>
<body  style="overflow:hidden;">
	<!-- 头部 -->
	<!-- 导航条
================================================== -->
<header id="amz-header" class="am-topbar am-topbar-fixed-top" >
    <div class="am-g">
        <div class="col-md-2 am-u-md-2">
            <h1>
            	<a href="#" target="_blank">帮工小哥</a>
            	<span class="am-badge am-badge-danger"><?php echo (C("APP_VERSION")); ?></span>
            </h1>
        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}">
            <span class="am-sr-only">导航切换</span>
            <span class="am-icon-bars"></span>
        </button>
		</div>
        
        <div class="col-md-10 am-u-md-10">
           
            <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
            	<ul class="amz-header-nav am-topbar-nav">
                    <?php if(is_array($__MENU__['main_menu'])): foreach($__MENU__['main_menu'] as $key=>$vo): ?><li>
                            <a href="<?php echo (U($vo["menu_url"])); ?>" style="outline:none;"><?php echo ($vo["menu_name"]); ?></a>
                        </li><?php endforeach; endif; ?>
                   
                </ul>
                <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
                    <li>
                        <a href="<?php echo U('Public/logout');?>"><span class="am-icon-sign-out" style="color:white;">注销</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</header>


	<style type="text/css">
		ul li{
			
			list-style:none;
		}
	</style>
	

	<!-- /头部 -->
	
	<!-- 主体 -->
	<div class="am-cf am-g">
    <!--左边开始---->
    <div class="am-u-sm-2 am-u-md-2 am-u-lg-2 admin-sidebar am-offcanvas am-offcanvas-style" id="admin-offcanvas">
        <div class="am-offcanvas-bar admin-offcanvas-bar left-style" >
   
	<div class="am-g admin-style">
        <div class="am-u-sm-4">
            <a href="#" class="am-icon-btn am-secondary  am-icon-drupal"></a>
        </div>
        <div class="am-u-sm-8">
            <?php echo ($ADMIN_NAME); ?>
            <br/>
            <a style="cursor:pointer;" title="退出" href="<?php echo U('Public/logout');?>"><span class="am-icon-power-off"></span></a>
            &nbsp; <a style="cursor:pointer;" title="修改密码" href="<?php echo U('Index/updatePassword');?>"><span class="am-icon-lock"></span></a>
        </div>
    </div>
    <ul class="am-list" >
        <?php if(is_array($__MENU__['_child'])): foreach($__MENU__['_child'] as $key=>$sub_menu): if(!empty($sub_menu)): ?><li>
            <a href="<?php echo (U($sub_menu["menu_url"])); ?>"><span class="<?php echo ((isset($sub_menu["menu_icon"]) && ($sub_menu["menu_icon"] !== ""))?($sub_menu["menu_icon"]):''); ?>">&nbsp;</span><?php echo ($sub_menu["menu_name"]); ?><span class="<?php echo ((isset($sub_menu["menu_style"]) && ($sub_menu["menu_style"] !== ""))?($sub_menu["menu_style"]):''); ?>"></span></a>
            <?php if(is_array($sub_menu['_child'])): foreach($sub_menu['_child'] as $key=>$menuname): ?><li class="am-margin-horizontal">
                    <a href="<?php echo (U($menuname["menu_url"])); ?>"><span class="<?php echo ((isset($menuname["menu_icon"]) && ($menuname["menu_icon"] !== ""))?($menuname["menu_icon"]):''); ?>">&nbsp;</span><?php echo ($menuname["menu_name"]); ?><span class="<?php echo ((isset($menuname["menu_style"]) && ($menuname["menu_style"] !== ""))?($menuname["menu_style"]):''); ?>"></span></a>
                </li><?php endforeach; endif; endif; ?>
        </li><?php endforeach; endif; ?>
    </ul>
</div>

    </div><!--左边结束---->
    <div class="am-u-sm-10 am-u-md-10 am-u-lg-10 custom-left am-fr" id="Contename"   >
        <div id="top-alert" class="fixed alert alert-error am-u-sm-12 am-u-md-12" style="display:none">
            <button class="close fixed" style="margin-top: 4px;">
                &times;
            </button>
            <div class="alert-content">
                这是内容
            </div>
        </div>
        
	<div class="am-cf am-padding-top">
		<div class="am-fl am-cf">
			<i class="am-icon-file"></i> <strong
				class="am-text-primary am-text-lg">超范围服务管理</strong>
		</div>
		<hr data-am-widget="divider" class="am-divider am-divider-default" />
	</div>
	
	<form class="am-form-horizontal" method="post" action="<?php echo U('addAction');?>">
		<input type="text" placeholder="0-3" name="charge" />
		<div class="am-btn-group am-btn-group-xs">
			<button type="submit" class="am-btn am-btn-success ajax-post"
				target-form="am-form-horizontal">
				<span class="am-icon-plus"></span>&nbsp;新增
			</button>
		</div>
		<hr data-am-widget="divider" class="am-divider am-divider-default" />
	</form>
	
	<table class="am-table am-table-striped am-table-hover table-main" id="table">
		<thead>
			<tr>
				<th class="table-check">
					<input type="checkbox" class="checkAll" />
				</th>
				<th class="table-title" style="width: 25%">范围最小值（单位：千米，包括）</th>
				<th class="table-title" style="width: 25%">范围最大值（单位：千米，不包括）</th>
				<th class="table-type" style="width: 25%">收费标准（元）</th>
				<th class="table-set" style="width: 20%">操作</th>
			</tr>
		</thead>
		<tbody>
			<?php if(!empty($list)): if(is_array($list)): foreach($list as $key=>$charge): ?><tr>
						<td>
							<input type="checkbox" value="<?php echo ($charge["charge_id"]); ?>" name="charge_ids[]" class="ck" /></td>
						<td>
							<input type="number" step="0.01" value="<?php echo ($charge["minimum"]); ?>" name="minimum" required />
						</td>
						<td>
							<input type="number" step="0.01" value="<?php echo ($charge["maximum"]); ?>" name="maximum" required />
						</td>
						<td>
							<input type="number" step="0.01" value="<?php echo ($charge["price"]); ?>" name="price" required />
						</td>
						<td>
							<div class="am-btn-toolbar">
								<div class="am-btn-group am-btn-group-xs">
									<a class="am-btn am-btn-default am-btn-xs am-text-secondary" name='update'>
										<span class="am-icon-pencil-square-o"></span>更新</a>
									<a class="am-btn am-btn-default am-btn-xs am-text-danger confirm ajax-get"
										href="<?php echo U('delAction?charge_id='.$charge['charge_id']);?>">
										<span class="am-icon-pencil-square-o"></span>删除</a>
								</div>
							</div>
						</td>
					</tr><?php endforeach; endif; ?> 
			<?php else: ?>
				<td colspan="6" class="text-center">暂时还没有内容!</td><?php endif; ?>
		</tbody>
	</table>

    </div>
</div>
<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"
  style="z-index:980;"></a>
</body>

</html>

	<!-- /主体 -->

	<!-- 底部 -->
	<!-- 底部
================================================== -->
<footer>
</footer>
<script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/blovex4.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
</script>
<!--[if lt IE 9]>
    <script src="/Public/Blovex4/js/jquery-1.8.min.js"></script>
    <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script src="/Public/Blovex4/js/polyfill/rem.min.js"></script>
	<script src="/Public/Blovex4/js/polyfill/respond.min.js"></script>
    <script src="/Public/Blovex4/js/amazeui.legacy.js"></script>
<![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="/Public/Common/js/jquery-2.0.3.min.js">
    </script>
    <script type="text/javascript" src="/Public/Common/js/amazeui.min.js">
    </script>
<!--<![endif]-->
<script src="/Public/Common/js/jquery.datetimepicker.js" type="text/javascript">
</script>
<script src="/Public/Blovex4/js/think.js" type="text/javascript">
</script>
<script src="/Public/Blovex4/js/custom.js" type="text/javascript">
</script>
<script src="/Public/Common/js/jquery.nicescroll.js" type="text/javascript">
</script>
 <script type="text/javascript">
	$(function() {
		//修改子类型
		$("#table").each(function() {
			$("a[name=update]").click(function() {
				
				var idtd = $(this).parents("tr").find("td:eq(0)")//下标0开始
				var chargeID = idtd.find(".ck").val();
				var mintd = $(this).parents("tr").find("td:eq(1)");
				var minimum = mintd.find("input").val();
				var maxtd = $(this).parents("tr").find("td:eq(2)");
				var maximum = maxtd.find("input").val();
				var pricetd = $(this).parents("tr").find("td:eq(3)");
				var price = pricetd.find("input").val();
				
				if ($.AMUI && $.AMUI.validator) {
					var target = Think.U('Charge/saveAction');
					$.post(target, {'charge_id':chargeID, 'min': minimum, 'max':maximum, 'price':price}, function(data){

						if(data.status == 1){
							updateAlert('操作成功~', 'alert-success');
						}else{
							updateAlert('操作失败~');
						}
						
						setTimeout(function() {
							$('#top-alert').find('button').click();
						}, 1500);
					})
				}
			});
		});
	});
</script> 
<!-- 用于加载js代码 -->


	<!-- /底部 -->
</body>
</html>